package pl.lodz.p.browarex.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.springframework.stereotype.Repository;

import pl.lodz.p.browarex.base.interfaces.IBaseModel;
import pl.lodz.p.browarex.model.enums.AnalysisTypeEnum;

@Entity
@Table(name = "ANALYSIES_LIST_TYPE")
@Repository
public class AnalysiesListType implements IBaseModel<Long> {

	private Long id;
	private Product product;
	private String productID;
	private Date discountExpiry;
	private Integer discountValue;
	private AnalysisTypeEnum type;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "ANALYSIS_LIST_TYPE_ID")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@OneToOne
	@JoinColumn(name = "PRODUCT_ID", unique = false, nullable = true)
	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	@Column(name = "PRODUCT_STRING_ID", unique = false, nullable = true)
	public String getProductID() {
		return productID;
	}

	public void setProductID(String productID) {
		this.productID = productID;
	}

	@Column(name = "DISCOUNT_EXPIRY", unique = false, nullable = true)
	public Date getDiscountExpiry() {
		return discountExpiry;
	}

	public void setDiscountExpiry(Date discountExpiry) {
		this.discountExpiry = discountExpiry;
	}

	@Column(name = "DISCOUNT_VALUE", unique = false, nullable = true)
	public Integer getDiscountValue() {
		return discountValue;
	}

	public void setDiscountValue(Integer discountValue) {
		this.discountValue = discountValue;
	}

	@Enumerated(EnumType.STRING)
	@Column(name = "TYPE", unique = false, nullable = false)
	public AnalysisTypeEnum getType() {
		return type;
	}

	public void setType(AnalysisTypeEnum type) {
		this.type = type;
	}
}
